//
//  Address.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/1/16.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "Address.h"

@implementation Address

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.name = [NSString stringWithFormat:@""];
        self.phone = [NSString stringWithFormat:@""];
        self.province = [NSString stringWithFormat:@""];
        self.city = [NSString stringWithFormat:@""];
        self.district = [NSString stringWithFormat:@""];
        self.address = [NSString stringWithFormat:@""];
        self.accurate = [NSString stringWithFormat:@""];
        self.label = [NSString stringWithFormat:@""];
        self.logistic = @"普通快递";
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super init];
    if (self) {
        self.name = [coder decodeObjectForKey:@"name"];
        self.phone = [coder decodeObjectForKey:@"phone"];
        self.province = [coder decodeObjectForKey:@"province"];
        self.city = [coder decodeObjectForKey:@"city"];
        self.district = [coder decodeObjectForKey:@"district"];
        self.address = [coder decodeObjectForKey:@"address"];
        self.accurate = [coder decodeObjectForKey:@"accurate"];
        self.logistic = [coder decodeObjectForKey:@"logistic"];
        self.label = [coder decodeObjectForKey:@"label"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
    [coder encodeObject:self.name forKey:@"name"];
    [coder encodeObject:self.phone forKey:@"phone"];
    [coder encodeObject:self.province forKey:@"province"];
    [coder encodeObject:self.city forKey:@"city"];
    [coder encodeObject:self.district forKey:@"district"];
    [coder encodeObject:self.address forKey:@"address"];
    [coder encodeObject:self.accurate forKey:@"accurate"];
    [coder encodeObject:self.logistic forKey:@"logistic"];
    [coder encodeObject:self.label forKey:@"label"];
}

@end
